package efu.nf.seckilldemo.web.controller;

import efu.nf.seckilldemo.common.base.BaseController;
import efu.nf.seckilldemo.common.result.ResultVO;
import efu.nf.seckilldemo.service.SeckillService;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lwj
 * @create 2025-09-28-16:28
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/api")
public class SeckillController extends BaseController {
    private final SeckillService seckillService;

    @PostMapping("/doSeckill")
    public<T> ResultVO<T> seckill(@RequestParam("userId") Integer userId,
                                  @RequestParam("goodId") Integer goodId) {
        seckillService.seckill(userId, goodId);
        return success();
    }
}